<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/views/common/includetag.jsp"%>
<!DOCTYPE html>
<html lang="en_US">
    <head>
        <title><spring:message code="app.template.title" /></title>
        <script type="text/javascript" src="${ctx}/static/js/manage/template/list.js"></script>
    </head>
    <body>
        <div class="clearfix"></div>
		<div class="row back-top-title">
			<div class="col-md-12">
				<span><spring:message code="app.template.title" /></span>
			</div>
		</div>

       	<div class="row">
			<div class="col-md-12">
				<div class="panel panel-white">
					<div class="panel-body">
						<div class="row">
							 <div class="col-md-12 space20">
								<a href="#none" class="btn btn-primary btn-add">
									<i class="fa fa-plus"></i>
									<spring:message code="app.common.action.add" />
								</a>
							 </div>
						</div>
						<form style="position:relative" id="splitPage" action="${ctx}/manage/downloadTemplate" method="POST" role="form" class="form-horizontal">  
							<table id="dataTable" class="table table-striped table-bordered table-hover table-full-width">
	                            <thead>
	                                <tr>
	                                    <th><spring:message code="app.common.title.serial" /></th>
	                                    <th><spring:message code="app.template.title.fileName" /></th>
	                                    <th><spring:message code="app.template.title.type" /></th>
	                                    <th><spring:message code="app.template.title.filePath" /></th>
	                                    <th><spring:message code="app.template.title.fileType" /></th>
	                                    <th><spring:message code="app.common.action.operate" /></th>
	                                </tr>
	                            </thead>
	                            <tbody>
	                                <c:forEach items="${pagination.datas}" var="entity" varStatus="s">
	                                    <tr data-id="${entity.id}">
	                                        <td><c:out value="${s.index + 1}" /></td>
	                                        <td><c:out value="${entity.fileName}" /></td>
	                                        <td><c:out value="${entity.type}" /></td>
	                                        <td><c:out value="${entity.filePath}" /></td>
	                                        <td><c:out value="${entity.fileType}" /></td>
	                                        <td>
	                                        	<a href="${ctx}/manage/downloadTemplate/download?id=${entity.id}" class="btn btn-primary btn_pos"><spring:message code="app.template.action.download" /></a>
	                                            <a href="${ctx}/manage/downloadTemplate/edit?id=${entity.id}" class="btn btn-info btn-sm"><spring:message code="app.common.action.edit" /></a>
	                                            <a href="#none" class="btn btn-danger btn-sm btn-delete"><spring:message code="app.common.action.delete" /></a>
	                                        </td>
	                                    </tr>
	                                </c:forEach>
	                            </tbody>
	                        </table>
	                        <div class="row" id="splitPageDiv">
								<jsp:include page="/views/common/splitPage.jsp">
									<jsp:param value="mainPanel" name="divId"/>
									<jsp:param value="splitPage" name="formId"/>
									<jsp:param value="splitPageDiv" name="splitPageDiv"/>
								</jsp:include>
							</div>
						</form>
				    </div>
				</div>
			</div>
		</div>
    </body>
</html>